<template>
  <div class="s-space">
    <div>
      <div id="page-index" class="wrapper clearfix">
        <div class="col-1">
          <tougaoconcent></tougaoconcent>
          <div class="section article">
            <h3 class="section-title">
              <a href="/455794881/article" class="t">我的专栏</a>
              <!---->
              <!---->
            </h3>
            <div class="content clearfix" style="display: none;">
              <div class="article-wrap"></div>
            </div>
          </div>
          <div class="section fav">
            <!-- <h3 class="section-title">
              <a href="/455794881/favlist" class="t">我的收藏夹</a>
              <span class="count">5</span>
            </h3> -->
            <!-- <div class="content clearfix">
              <div
                data-count="http://i2.hdslb.com/bfs/archive/6d090128cd159a9e40bc70610b1750e1b74d238d.jpg"
                class="fav-item"
              >
                <a href="/455794881/favlist?fid=708334081&amp;ftype=create" class="fav-covers"> -->
                  <!-- <div class="b-img">
                    <picture class="b-img__inner">
                      <source
                        type="image/avif"
                        srcset="//i2.hdslb.com/bfs/archive/6d090128cd159a9e40bc70610b1750e1b74d238d.jpg@304w_304h_1c_!web-space-index-myfav.avif"
                      />
                      <source
                        type="image/webp"
                        srcset="//i2.hdslb.com/bfs/archive/6d090128cd159a9e40bc70610b1750e1b74d238d.jpg@304w_304h_1c_!web-space-index-myfav.webp"
                      />
                      <img
                        src="//i2.hdslb.com/bfs/archive/6d090128cd159a9e40bc70610b1750e1b74d238d.jpg@304w_304h_1c_!web-space-index-myfav.webp"
                        alt="默认收藏夹"
                        loading="lazy"
                        onload="bmgOnLoad(this)"
                        onerror="bmgOnError(this)"
                        data-onload="bmgCmptOnload"
                      />
                    </picture>
                  </div> -->
                  <!---->
                <!-- </a> -->
                <!-- <span class="fav-count">42</span>
                <div class="m">
                  <span class="state">公开</span>
                  <a
                    href="/455794881/favlist?fid=708334081&amp;ftype=create"
                    class="name"
                    title="默认收藏夹"
                    style=" font-size: 16px;"
                  >默认收藏夹</a>
                </div> -->
              <!-- </div>
            </div> -->

            
          </div>
         
        </div>
        <div class="col-2">
          <div class="section i-ann">
            <h3 class="section-title">个人信息</h3>
            <div class="content" style="text-align:left;" :v-model="user">
              <p>uid:{{user.userId}}</p>
              <p>账号：{{user.userCode}}</p>
              <p>昵称：{{user.userName}}</p>
             
              <p>生日：{{formatDate(user.userBirthday)}}</p>
              <p>邮箱：{{user.userEmail}}</p>
              <p>手机号：{{user.userPhone}}</p>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import tougaoconcent from "@/views/personal/tougaoconcent";
export default {
  name: "zhuye",
  data() {
    return {
      UserUrl:'',
      user: {
        userId: "",
        userName: "",
        userBirthday: "",
        userCode: "",
      
        userEmail: "",
        userPhone: ""
      }
    };
  },
    created() {
    this.getPersonUser();
  },
  methods: {
       formatDate(dateStr) {
      const date = new Date(dateStr);
      const year = date.getFullYear();
      const month = String(date.getMonth() + 1).padStart(2, "0");
      const day = String(date.getDate()).padStart(2, "0");
      return `${year}-${month}-${day}`;
    },
    getPersonUser() {
     
      this.axios({
        method: "get",
        params: {
          id: this.$route.params.userId
        },
        url: "http://localhost:8090/user/get"
      })
        .then(res => {
          this.user.userCode = res.data.userCode;
          this.user.userId = res.data.userId;
          this.user.userEmail = res.data.userEmail;
         
          this.user.userName = res.data.userName;
          this.user.userBirthday = res.data.userBirthday;
          this.user.userPhone = res.data.userPhone;
          this.UserUrl = res.data.userAvatar;

          this.$message({
            type: "success",
            message: "成功!"
          });
        })
        .catch(e => {
           this.$message.error(e.response.data.message);
        });
    }
  },
  components: {
    tougaoconcent
  }
};
</script>
<style   scoped>
@import "//s1.hdslb.com/bfs/static/jinkela/space/css/space.10.9f1374eeec86fa11c6ebad565e9755d06d7d0fc1.css";
@import "//s1.hdslb.com/bfs/static/jinkela/space/css/space.10.9f1374eeec86fa11c6ebad565e9755d06d7d0fc1.css";
@import "//s1.hdslb.com/bfs/static/jinkela/space/css/space.3.9f1374eeec86fa11c6ebad565e9755d06d7d0fc1.css";
@import "//s1.hdslb.com/bfs/static/jinkela/space/css/space.8.9f1374eeec86fa11c6ebad565e9755d06d7d0fc1.css";
</style>
